from django.contrib import admin
from .models import *
from django import forms


@admin.register(DnsRecord)
class dns_list(admin.ModelAdmin):
    ordering = ['zone']
    list_display = [ 'host', 'type', 'zone','data', 'ttl', 'gmt_modified']
    list_filter = ['zone']
    list_editable = ('data',)
    list_per_page = 50
    search_fields = ['data']
    fields = ('zone', 'host', 'type', 'data', 'ttl', 'primary_ns')


@admin.register(Zone)
class zones_list(admin.ModelAdmin):
    list_display = ['zone', 'get_items','status', 'gmt_create','comment']
    list_editable = ('status',)
    readonly_fields = ('get_items',)


admin.site.site_header = '域名管理后台'
admin.site.site_title = '域名管理系统'